<html>
<head>
	<meta charset="UTF-8">
	<title>Js Learn Page</title>

	<!-- <script type="text/javascript" src="../assets/js/app.js"></script> -->

	<style>
		.time {
		    position: absolute;
		    top: 42%;
		    left: 50%;
		    font-size: 24px;
		    color: white;
		}
	</style>

	<script>
		
		window.onload = function() {

			setInterval(function() {
				var d = new Date();
				var hour = d.getHours();
				hour = hour < 10 ? "0" + hour : hour;
				var minutes = d.getMinutes();
				minutes = minutes < 10 ? "0" + minutes : minutes;
				var seconds = d.getSeconds();
				seconds = seconds < 10 ? "0" + seconds : seconds;
				var time = document.getElementById("time");
				time.innerHTML = hour + ":" + minutes + ":" + seconds;

				document.body.style.backgroundColor = "#" + seconds + seconds + seconds;
			}, 1000);
			
		}
	</script>
</head>
<body>
	<div id="time" class="time"></div>
</body>
</html>